<?php 
$sql =	"SELECT
			  c.page_id,
			  d.title,
			  d.description
			  	
		  FROM
			  pages AS c,
			  page_description AS d,
			  sef_url AS s
		  WHERE
		  
			  c.page_id = d.page_id
			  AND
			  d.lang_id = '".$_SESSION['lang_id']."'
			  
			  AND
				c.page_id = s.query
				AND
				s.lang_id = '".$_SESSION['lang_id']."'
				AND s.tamplate = 'page'
			 
			  AND
				s.sef_url = 'search' 
		  ";


$result = query($sql);
$row = mysql_fetch_object($result);
$_SESSION['search'] = $_REQUEST['prm2'];
head(sth($row->title));



?>
		<div class="wrapper-all-projects cf">
            <header id="header" class="cf">
                <div id="search-icon"></div>
                <div id="logo"></div>
                <div id="menu-icon"></div>
            </header> <!--# header-->

            <section id="content-projects">
                <article id="projects" class="cf">
         
                <h1><?=stripslashes($row->title)?></h1>
                <?=stripslashes($row->description)?> "<?=$_SESSION['search']?>"
                
               
                <div id="grid" class="cf"> 
                	 <?php
                        		$sql = "SELECT p.project_id, p.cover, p.cover_class, d.title , s.sef_url FROM
										projects AS p,
										project_description AS d,
										sef_url AS s
									WHERE
			  							p.project_id = d.project_id
									AND
										s.query = p.project_id
									AND
										s.tamplate	= 'project'
									AND
										s.lang_id = '".$_SESSION['lang_id']."'
									AND
									    d.lang_id = '".$_SESSION['lang_id']."' 
									AND p.published
									
									AND ( d.title LIKE '%".escape($_REQUEST['prm2'])."%'
									
									OR d.description LIKE '%".escape($_REQUEST['prm2'])."%' )
										ORDER BY p.order_number DESC";
								$result = query($sql);
						
						while ($row = mysql_fetch_object($result)) {
						?>                 
                    <a href="<?=HTML_BASE.$_SESSION['lang']?>/projects/<?=$row->sef_url?>" title="<?=$row->title?>" class="item <?=$row->cover_class?>" data-groups='["all",<?=getClass($row->project_id)?> ]' style="background-image: url(<?=HTML_BASE?>project_images/medium/<?=$row->cover?>);"></a>
                    <?php }?>
                    <div class="shuffle-sizer"></div>
                </div> 
            </article>
        </section> <!--# content--> 


<?php
foot();
?>